//
//  HTFrameNet.h
//   网络访问相关
//
//  Created by standychen on 14-11-4.
//  Copyright (c) 2014年 HT. All rights reserved.
//

#import <Foundation/Foundation.h>

@interface HTFrameNet : NSObject
@property NSMutableString *ServerUrl;

//默认服务器地址设置
+(void)defaultServerUrlSet:(NSString *)str;

//默认服务器虚拟目录设置，一般不使用
+(void)defaultServerVirSet:(NSString *)str;

//初始化 默认URL
-(HTFrameNet *)init;

//初始化 传入URL
-(HTFrameNet *)initWithServerUrl:(NSString *)serverUrl;


//获得服务器默认地址
+(NSString *)hmGetServerUrl;

//访问WCF服务返回结果串
-(void)hmNetWCFmethodName:(NSString *)methodName andDic:(NSDictionary *)dict complete:(void(^)(NSString *backstr))block;// andSel:(SEL)action;



//访问NET服务并返回结果JSON字符串，如果错误返回NULL字符串，不执行操作
//使用ASI
//传入类名+方法名；参数字典；处理返回结果的代码块
//同步访问
-(void)hmNetASImethodName:(NSString *)methodName complete:(void(^)(NSString *backstr))block;

//转换数据库标题字符串为字典格式
+(NSDictionary *)hmConvertDictFromTitleStr:(NSString *)titleStr;

//接受到字符串转换为Json字符串
+(NSString *)hmConvertJsonStrFromWCF:(NSString *)receiveStr;

//转换json字符串为字典
+(NSDictionary *)hmConvertDictFromJsonStr:(NSString *)jsonStr;


//转换json字符串为数组
+(NSMutableArray *)hmConvertArrayFromJsonStr:(NSString *)jsonStr;


//转换json字符串为数组，数组内为字典，对应C#中的DataTable
+(NSMutableArray *)hmConvertDataTableFromJsonStr:(NSString *)jsonStr;


//转换json字符串为标准字典_单表表单
+(NSDictionary *)hmConvertFormFromJsonStr:(NSString *)jsonStr;

//转换json字符串为标准字典_主从表表单
+(NSDictionary *)hmConvertFormDtsFromJsonStr:(NSString *)jsonStr;



@end
